﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;

namespace KPIS.GERP.Models.HRM
{
    [DataContract, Table("HrmFieldPosition")]
    public class FieldPosition
    {
        public FieldPosition()
        {

        }

        [Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        [DataMember, Display(Name = "FieldPosId", ResourceType = typeof(Resources.FieldPositionResource))]
        public int FieldPosId { get; set; }

        [DataMember, Display(Name = "Code", ResourceType = typeof(Resources.FieldPositionResource))]
        public string Code { get; set; }

        [DataMember, Display(Name = "Name", ResourceType = typeof(Resources.FieldPositionResource))]
        public string Name { get; set; }

        [DataMember, Display(Name = "NameEng", ResourceType = typeof(Resources.FieldPositionResource))]
        public string NameEng { get; set; }

        //[DataMember, Display(Name = "FieldPosId", ResourceType = typeof(Resources.FieldPositionResource))]
        //public string field_pos_line { get; set; }

        //[DataMember, Display(Name = "FieldPosId", ResourceType = typeof(Resources.FieldPositionResource))]
        //public string field_pos_line_short { get; set; }

        //[DataMember, Display(Name = "FieldPosId", ResourceType = typeof(Resources.FieldPositionResource))]
        //public string field_pos_line_eng { get; set; }

        [ForeignKey("MasEmployeeType")]
        [DataMember, Display(Name = "EmpTypeId", ResourceType = typeof(Resources.FieldPositionResource))]
        public Nullable<int> EmpTypeId { get; set; }

        [ForeignKey("MasPositionType")]
        [DataMember, Display(Name = "PosTypeId", ResourceType = typeof(Resources.FieldPositionResource))]
        public Nullable<int> PosTypeId { get; set; }

        //[ForeignKey("hrm_mp_field_groups")]
        [DataMember, Display(Name = "FieldGroupId", ResourceType = typeof(Resources.FieldPositionResource))]
        public Nullable<int> FieldGroupId { get; set; }

        //[ForeignKey("ClassSpecification")]
        [DataMember, Display(Name = "ClassSpecId", ResourceType = typeof(Resources.FieldPositionResource))]
        public Nullable<int> ClassSpecId { get; set; }

        [DataMember, Display(Name = "Remarks", ResourceType = typeof(Resources.FieldPositionResource))]
        public string Remarks { get; set; }

        [DataMember, Display(Name = "RecordStatus", ResourceType = typeof(Resources.FieldPositionResource))]
        public string RecordStatus { get; set; }
        public int? CreatedBy { get; set; }
        public DateTime? CreatedWhen { get; set; }
        public int? UpdatedBy { get; set; }
        public DateTime? UpdatedWhen { get; set; }

        [DataMember]
        public MasEmployeeType MasEmployeeType { get; set; }
        [DataMember]
        public MasPositionType MasPositionType { get; set; }
        //[DataMember]
        //public hrm_mp_field_groups hrm_mp_field_groups { get; set; }
        //[DataMember]
        //public ClassSpecification ClassSpecification { get; set; }

        //protected override void OnModelCreating(DbModelBuilder modelBuilder)
        //{
        //    modelBuilder.Entity<hrm_mp_field_positions>()
        //        .HasRequired(p => p.hrm_mp_class_specifications)
        //        .WithMany()
        //        .Map(p => p.MapKey("FkFieldClassSpecClassSpecSeq"))
        //        ;
        //}
    }
}
